package prototype.persistence.hibernate;

import java.util.List;
import java.sql.Timestamp;

import prototype.persistence.pojo.Unit;
import prototype.persistence.UnitDAO;

import org.hibernate.criterion.Restrictions;

/**
 * <p>Hibernate DAO layer for Units</p>
 * <p>Generated at Sun Jan 03 13:49:53 EET 2010</p>
 *
 * @author Salto-db Generator v1.0.16 / Pojos + Hibernate mapping + Generic DAO
 * @see http://www.hibernate.org/328.html
 */
public class UnitHibernateDAO extends
		AbstractHibernateDAO<Unit, Integer> implements
		UnitDAO {

	/**
	 * Find Unit by name
	 */
	public List<Unit> findByName(String name) {
		return findByCriteria(Restrictions.eq("name", name));
	}
	
	/**
	 * Find Unit by className
	 */
	public List<Unit> findByClassName(String className) {
		return findByCriteria(Restrictions.eq("className", className));
	}
	
	/**
	 * Find Unit by jessFile
	 */
	public List<Unit> findByJessFile(String jessFile) {
		return findByCriteria(Restrictions.eq("jessFile", jessFile));
	}
	
	/**
	 * Find Unit by modelFile
	 */
	public List<Unit> findByModelFile(String modelFile) {
		return findByCriteria(Restrictions.eq("modelFile", modelFile));
	}
	
	/**
	 * Find Unit by health
	 */
	public List<Unit> findByHealth(Integer health) {
		return findByCriteria(Restrictions.eq("health", health));
	}
	
	/**
	 * Find Unit by armor
	 */
	public List<Unit> findByArmor(Integer armor) {
		return findByCriteria(Restrictions.eq("armor", armor));
	}
	
	/**
	 * Find Unit by movementRate
	 */
	public List<Unit> findByMovementRate(Integer movementRate) {
		return findByCriteria(Restrictions.eq("movementRate", movementRate));
	}
	
	/**
	 * Find Unit by firePower
	 */
	public List<Unit> findByFirePower(Integer firePower) {
		return findByCriteria(Restrictions.eq("firePower", firePower));
	}
	
	/**
	 * Find Unit by rangeDistance
	 */
	public List<Unit> findByRangeDistance(Integer rangeDistance) {
		return findByCriteria(Restrictions.eq("rangeDistance", rangeDistance));
	}
	
	/**
	 * Find Unit by reloadTime
	 */
	public List<Unit> findByReloadTime(Integer reloadTime) {
		return findByCriteria(Restrictions.eq("reloadTime", reloadTime));
	}
	
	/**
	 * Find Unit by accuracy
	 */
	public List<Unit> findByAccuracy(Integer accuracy) {
		return findByCriteria(Restrictions.eq("accuracy", accuracy));
	}
	
	/**
	 * Find Unit by fireEffectRadius
	 */
	public List<Unit> findByFireEffectRadius(Integer fireEffectRadius) {
		return findByCriteria(Restrictions.eq("fireEffectRadius", fireEffectRadius));
	}
	

}
